using System;
using GalaSoft.MvvmLight;

namespace ArchiSimple.Windows.ViewModel
{
    /// <summary>
    /// This class contains properties that the main View can data bind to.
    /// <para>
    /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
    /// </para>
    /// <para>
    /// You can also use Blend to data bind with the tool's support.
    /// </para>
    /// <para>
    /// See http://www.galasoft.ch/mvvm
    /// </para>
    /// </summary>
    public class MainViewModel : ViewModelBase
    {
        public enum MainNavigation
        {
            File,
            Plan,
        }

        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
        }

        public virtual MainNavigation Screen
        {
            get { return this.Get<MainNavigation>("Screen"); }
            set { this.Set("Screen", value); }
        }

        public override void Init()
        {
            this.NavigationAction = m =>
            {
                MainNavigation outNavigationEnum;

                if (Enum.TryParse<MainNavigation>(m.Name, out outNavigationEnum))
                {
                    this.Screen = outNavigationEnum;
                }
            };

            base.Init();
        }
    }
}